﻿@using GigaSite.Domain.Entities
@using GigaSite.Web.Areas.Catalog.Models
@using GigaSite.Web.Classes
@model dynamic

@* Партиал вью с элементами для пейджионирования *@
@{
    var page = (int) ViewBag.page;
    var itemsPerPage = (int) ViewBag.itemsPerPage;
    var category = (Category) ViewBag.category;
    var totalAds = (int) ViewBag.adsCount;
    var totalPagesCount = MathHelper.PagesCount(totalAds, itemsPerPage);
}

<div class="dataHolder" data-page="@page" data-totalitems="@totalAds" data-totalpages="@totalPagesCount" data-itemsperpage="@itemsPerPage"></div>

@* Верхний пагинатор *@
@*@Html.Partial("PaginatorTop")*@

@* Сам набор карточек *@
<div class="overview">
    @{
        Html.RenderAction("GetAdvs",new {categoryId = category.Id, page = page, itemsPerPage = itemsPerPage});
    }
</div>

@* Нижний пагинатор *@
@Html.Partial("PaginatorBottom",new BottomPaginatorModel()
                                          {
                                              Page = page,
                                              ItemsPerPage = itemsPerPage,
                                              TotalItems = totalAds,
                                              TotalPages = totalPagesCount
                                          })

